﻿using UnityEngine;
using UnityEngine.UI;

/// <summary>
/// Makes it possible to animate a color of the widget.
/// </summary>

[ExecuteInEditMode]
[RequireComponent(typeof(Graphic))]
public class UGUIAnimatedColor : MonoBehaviour
{
	public Color color = Color.white;

    Graphic mWidget;

	void OnEnable () { mWidget = GetComponent<Graphic>(); LateUpdate(); }
	void LateUpdate () { mWidget.color = color; }
}
